package com.cloud.xtools.common.validator.annotation;

import com.cloud.xtools.common.validator.SizeIfExistValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * @author Daixinguo
 */
@Documented
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = SizeIfExistValidator.class)
public @interface SizeIfExist {
    String message() default "长度必须在 {min} 到 {max} 个字符之间";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
    int min();
    int max();
}
